from rakg.graph_utils import *
from rakg.timer import *
import rakg.graphsim as gsim
import numpy as np
import networkx as nx

def main():
    t = Timerx(True)
    path = "/Users/rockyrock/Desktop/all.txt"
    G = read_graph(path)
    U = build_U(G.nodes())
    Y = build_Y(G, U)
    print G.number_of_nodes()
    print len(U), len(Y)
    
    degrees = gsim.get_degrees_list(G)
    A = nx.adj_matrix(G)
    A = np.asarray(A)
    
    print 'cn'
    t.start()
    S = gsim.aa(A,degrees)
    t.stop()
#     i = G.nodes().index('1')
#     j = G.nodes().index('52')
#     print S[i,j]
#     print S
    
    
main()